summaryrefslogtreecommitdiffstats
path: root/src/pages/thematique/[slug].tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-20 00:15:20 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-20 00:15:20 +0100
commitfa6adedc42e9c6ec39cc30df16b54900c220b094 (patch)
tree6bb498beadaa382245cecb86ce56931580313c6f /src/pages/thematique/[slug].tsx
parent2ff898626c5c0abc6b8195224067b992403e313b (diff)
refactor: rewrite types and services
I was repeating myself a lot in services. So I rewrited the different functions to improve readability and I extracted some formatting functions to put them in utils. I also rewrited/reorganized some types to keep consistent names.
Diffstat (limited to 'src/pages/thematique/[slug].tsx')
-rw-r--r--src/pages/thematique/[slug].tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pages/thematique/[slug].tsx b/src/pages/thematique/[slug].tsx
index 1919b59..2e7c346 100644
--- a/src/pages/thematique/[slug].tsx
+++ b/src/pages/thematique/[slug].tsx
@@ -1,10 +1,6 @@
import Layout from '@components/Layouts/Layout';
import PostPreview from '@components/PostPreview/PostPreview';
import { t } from '@lingui/macro';
-import {
- fetchAllThematicsSlug,
- getThematicBySlug,
-} from '@services/graphql/taxonomies';
import { NextPageWithLayout } from '@ts/types/app';
import { ThematicProps } from '@ts/types/taxonomies';
import { loadTranslation } from '@utils/helpers/i18n';
@@ -12,6 +8,10 @@ import { GetStaticPaths, GetStaticProps, GetStaticPropsContext } from 'next';
import { ParsedUrlQuery } from 'querystring';
import { ReactElement } from 'react';
import styles from '@styles/pages/Thematic.module.scss';
+import {
+ getAllThematicsSlug,
+ getThematicBySlug,
+} from '@services/graphql/queries';
const Thematic: NextPageWithLayout<ThematicProps> = ({ thematic }) => {
const getPostsList = () => {
@@ -66,7 +66,7 @@ export const getStaticProps: GetStaticProps = async (
};
export const getStaticPaths: GetStaticPaths = async () => {
- const allSlugs = await fetchAllThematicsSlug();
+ const allSlugs = await getAllThematicsSlug();
return {
paths: allSlugs.map((post) => `/thematique/${post.slug}`),